package com.fick.util;

/**
 * Description:  ��������
 * @author       wtj
 * @version 1.0
 */
import java.lang.StringBuffer;

public class OldPager {
	// ���嵱ǰ��ָ��ҳ��ı�
	private static int currentPage = 1;

	// ������ҳ��ı�
	private static int totalNum = 0;

	private static int totalCount = 0;

	// ��������
	public static StringBuffer output = new StringBuffer();

	/**
	 * �趨��ʹ������
	 */
	public void init(int currentPage, int totalNum, int totalCount) {
		this.currentPage = currentPage;

		this.totalNum = totalNum;

		this.totalCount = totalCount;

	}

	/**
	 * �趨
	 */

	/**
	 * �趨
	 */
	public String printTable(String page) {
		output.delete(0, output.length());
		output.append("<form method=post name=page action='" + page + "'>\n"
				+ "<table width=100% cellspacing=0 cellpadding=0 >\n");
		output.append("<tr>\n");
		output.append("<td align=center class=fContent>��" + totalCount + "��</td>\n");

		if (currentPage <= 1) {
			output.append("<td align=center class=fContent><div align=left>��ҳ</div></td>\n");
			output.append("<td  align=center  class=fContent><div align=left>��һҳ</div></td>\n");
		} else {
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page
					+ "?currPage=1'>��ҳ</a></div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
					+ (currentPage - 1) + "'>��һҳ</a></div></td>\n");
		}
		if (currentPage != totalNum && totalNum != 0) {
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
					+ (currentPage + 1) + "'>��һҳ</a></div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
					+ totalNum + "'>���ҳ</a></div></td>\n");
		} else {
			output.append("<td align=center  class=fContent> <div align=left>��һҳ</div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left>���ҳ</div></td>\n");
		}

		output.append("<td align=center  class=fContent> <div align=left>��ǰ��" + currentPage + "ҳ/��" + totalNum
				+ "ҳ</div></td>\n");
		output.append("<td align=center  class=fContent><div align=left>����\n");
		if (totalNum == 0) {
			output.append("<select name=currPage onChange='this.form.submit()' disabled>\n");
		} else {
			output.append("<select name=currPage onChange='this.form.submit()'>\n");
		}
		for (int i = 1; i <= totalNum; i++) {
			if (i == currentPage) {
				output.append("<option value=" + i + " selected>" + i + "</option>\n");
			} else {
				output.append("<option value=" + i + ">" + i + "</option>\n");
			}
		}
		output.append("</select>ҳ\n");
		output.append("</tr></table></form>\n");

		return output.toString();
	}

	public String nprintTable(String page) {// �Լ����ϵģ����ڶ���Щ��ϲ�ѯ��ҳ����з���ʹ�ã����Ĳ����(���url
		output.delete(0, output.length());
		output.append("<form method=post name=page action='" + page + "'>\n"
				+ "<table width=100% cellspacing=0 cellpadding=0 >\n");
		output.append("<tr>\n");
		output.append("<td align=center class=fContent>��" + totalCount + "��</td>\n");

		if (currentPage <= 1) {
			output.append("<td align=center class=fContent><div align=left>��ҳ</div></td>\n");
			output.append("<td  align=center  class=fContent><div align=left>��һҳ</div></td>\n");
		} else {
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page
					+ "&currPage=1'>��ҳ</a></div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
					+ (currentPage - 1) + "'>��һҳ</a></div></td>\n");
		}
		if (currentPage != totalNum && totalNum != 0) {
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
					+ (currentPage + 1) + "'>��һҳ</a></div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
					+ totalNum + "'>���ҳ</a></div></td>\n");
		} else {
			output.append("<td align=center  class=fContent> <div align=left>��һҳ</div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left>���ҳ</div></td>\n");
		}

		output.append("<td align=center  class=fContent> <div align=left>��ǰ��" + currentPage + "ҳ/��" + totalNum
				+ "ҳ</div></td>\n");
		output.append("<td align=center  class=fContent><div align=left>����\n");
		if (totalNum == 0) {
			output.append("<select name=currPage onChange='this.form.submit()' disabled>\n");
		} else {
			output.append("<select name=currPage onChange='this.form.submit()'>\n");
		}
		for (int i = 1; i <= totalNum; i++) {
			if (i == currentPage)
				output.append("<option value=" + i + " selected>" + i + "</option>\n");
			else
				output.append("<option value=" + i + ">" + i + "</option>\n");
		}
		output.append("</select>ҳ\n");
		output.append("</tr></table></form>\n");

		return output.toString();
	}

	public static String nprintTable(String page, int currPage, int totalPage, int totalCount, String str) {// �Լ����ϵģ����ڶ���Щ��ϲ�ѯ��ҳ����з���ʹ�ã����Ĳ����(���url
		output.delete(0, output.length());
		output.append("<form method=post name=page action='" + page + "'>\n");
		// output.append("<tr>\n");
		output.append("��" + totalCount + "��&nbsp;&nbsp;");
		if (currPage <= 1) {
			output.append("��ҳ&nbsp;&nbsp;");
			output.append("��һҳ&nbsp;&nbsp;");
		} else {
			output.append("<a href='" + page + str + "currPage=1'>��ҳ</a>&nbsp;&nbsp;");
			output.append("<a href='" + page + str + "currPage=" + (currPage - 1) + "'>��һҳ</a>&nbsp;&nbsp;");
		}
		if (currPage != totalPage && totalPage != 0) {
			output.append("<a href='" + page + str + "currPage=" + (currPage + 1) + "'>��һҳ</a>&nbsp;&nbsp;");
			output.append("<a href='" + page + str + "currPage=" + totalPage + "'>���ҳ</a>&nbsp;&nbsp;");
		} else {
			output.append("��һҳ&nbsp;&nbsp;");
			output.append("���ҳ&nbsp;&nbsp;");
		}
		output.append("��ǰ��" + currPage + "ҳ/��" + totalPage + "ҳ&nbsp;&nbsp;");
		output.append("����");
		if (totalPage == 0) {
			output.append("<select name=currPage onChange='this.form.submit()' disabled>\n");
		} else {
			output.append("<select name=currPage onChange='this.form.submit()'>\n");
		}
		for (int i = 1; i <= totalPage; i++) {
			if (i == currPage)
				output.append("<option value=" + i + " selected>" + i + "</option>\n");
			else
				output.append("<option value=" + i + ">" + i + "</option>\n");
		}
		output.append("</select>ҳ\n");
		output.append("</form>\n");
		return output.toString();
	}

	public static String nprintTables(String page, int currPage, int totalPage, int totalCount, String str) {// �Լ����ϵģ����ڶ���Щ��ϲ�ѯ��ҳ����з���ʹ�ã����Ĳ����(���url
		output.delete(0, output.length());
		output.append("<form method=post name=page action='" + page + "'>\n"
				+ "<table width=100% cellspacing=0 cellpadding=0 >\n");
		output.append("<tr>\n");
		output.append("<td align=center class=fContent>��" + totalCount + "��</td>\n");

		if (currPage <= 1) {
			output.append("<td align=center class=fContent><div align=left>��ҳ</div></td>\n");
			output.append("<td  align=center  class=fContent><div align=left>��һҳ</div></td>\n");
		} else {
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + str
					+ "currPage=1'>��ҳ</a></div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + str + "currPage="
					+ (currPage - 1) + "'>��һҳ</a></div></td>\n");
		}
		if (currPage != totalPage && totalPage != 0) {
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + str + "currPage="
					+ (currPage + 1) + "'>��һҳ</a></div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left><a href='" + page + str + "currPage="
					+ totalPage + "'>���ҳ</a></div></td>\n");
		} else {
			output.append("<td align=center  class=fContent> <div align=left>��һҳ</div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left>���ҳ</div></td>\n");
		}

		output.append("<td align=center  class=fContent> <div align=left>��ǰ��" + currPage + "ҳ/��" + totalPage
				+ "ҳ</div></td>\n");
		output.append("<td align=center  class=fContent><div align=left>����\n");
		if (totalPage == 0) {
			output.append("<select name=currPage onChange='this.form.submit()' disabled>\n");
		} else {
			output.append("<select name=currPage onChange='this.form.submit()'>\n");
		}
		for (int i = 1; i <= totalPage; i++) {
			if (i == currPage)
				output.append("<option value=" + i + " selected>" + i + "</option>\n");
			else
				output.append("<option value=" + i + ">" + i + "</option>\n");
		}
		output.append("</select>ҳ\n");
		output.append("</tr></table></form>\n");

		return output.toString();
	}

	public String printTable(String page, String paraName, String parameter) {
		output.delete(0, output.length());
		output.append("<form method=post action='" + page + "'>\n"
				+ "<table width=100%  cellspacing=0 cellpadding=0>\n");
		output.append("<tr >\n");
		output.append("<td align=center  class=fContent>��" + totalCount + "��</td>\n");

		if (currentPage <= 1) {
			output.append("<td align=center   class=fContent><div align=left>��ҳ</div></td>\n");
			output.append("<td  align=center  class=fContent><div align=left>��һҳ</div></td>\n");
		} else {
			// ����Ϊ�յ����
			if (parameter != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName + "=" + parameter + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName + "=" + parameter + "'>��һҳ</a></div></td>\n");

			} else {

				output.append("<td align=center   class=fContent> <div align=left><a href='" + page
						+ "?currPage=1'>��ҳ</a></div></td>\n");
				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "'>��һҳ</a></div></td>\n");

			}

		}
		if (currentPage != totalNum && totalNum != 0) {

			// ����Ϊ�յ����
			if (parameter != null) {

				output.append("<td align=center   class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName + "=" + parameter + "'>��һҳ</a></div></td>\n");
				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName + "=" + parameter + "'>���ҳ</a></div></td>\n");

			} else {

				output.append("<td align=center    class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "'>��һҳ</a></div></td>\n");
				output.append("<td align=center   class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "'>���ҳ</a></div></td>\n");

			}

		} else {
			output.append("<td align=center class=fContent> <div align=left>��һҳ</div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left>���ҳ</div></td>\n");
		}

		output.append("<td align=center  class=fContent> <div align=left>��ǰ��" + currentPage + "ҳ/��" + totalNum
				+ "ҳ</div></td>\n");
		output.append("<td align=center  class=fContent><div align=left>����\n");
		if (totalNum == 0) {
			output.append("<select name=currPage onChange='this.form.submit()' disabled>\n");
		} else {
			output.append("<select name=currPage onChange='this.form.submit()'>\n");
		}
		for (int i = 1; i <= totalNum; i++) {
			if (i == currentPage) {
				output.append("<option value=" + i + " selected>" + i + "</option>\n");
			} else {
				output.append("<option value=" + i + ">" + i + "</option>\n");
			}
		}
		output.append("</select>ҳ\n");
		output.append("</tr></table></form>\n");

		return output.toString();
	}

	/**
	 * 
	 * @param page
	 * @param paraName1
	 * @param parameter1
	 * @param paraName2
	 * @param parameter2
	 * @return
	 */
	public String printTable(String page, String paraName1, String parameter1, String paraName2, String parameter2) {
		output.delete(0, output.length());
		if (parameter1 != null && parameter2 != null) {
			output.append("<form method=post name=page action=" + page + "?" + paraName1 + "=" + parameter1 + "&"
					+ paraName2 + "=" + parameter2 + ">\n");

		}
		if (parameter1 != null && parameter2 == null) {
			output.append("<form method=post name=page action=" + page + "?" + paraName1 + "=" + parameter1 + ">\n");

		}
		if (parameter1 == null && parameter2 != null) {
			output.append("<form method=post name=page action=" + page + "?" + paraName2 + "=" + parameter2 + ">\n");

		}
		if (parameter1 == null && parameter2 == null) {
			output.append("<form method=post name=page action=" + page + ">\n");

		}

		output.append("<table width=100%>\n");
		output.append("<tr>\n");
		if (parameter1 == null && parameter2 == null) {
			output.append("<td align=center  class=fContent>��" + totalCount + "��</td>\n");
		} else {
			output.append("<td align=center  class=fContent><font color=#FF0000>�������ѯ����Ĺ�" + totalCount
					+ "��</font></td>\n");
		}

		if (currentPage <= 1) {
			output.append("<td align=center  class=fContent><div align=left>��ҳ</div></td>\n");
			output.append("<td  align=center  class=fContent><div align=left>��һҳ</div></td>\n");
		} else {
			// ����Ϊ�յ����
			if (parameter1 != null && parameter2 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>��һҳ</a></div></td>\n");

			} else if (parameter1 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName1 + "=" + parameter1 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName1 + "=" + parameter1 + "'>��һҳ</a></div></td>\n");
			} else if (parameter2 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName2 + "=" + parameter2 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName2 + "=" + parameter2 + "'>��һҳ</a></div></td>\n");

			}

			else {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page
						+ "?currPage=1'>��ҳ</a></div></td>\n");
				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "'>��һҳ</a></div></td>\n");

			}

		}

		if (currentPage != totalNum && totalNum != 0) {

			// ����Ϊ�յ����
			if (parameter1 != null && parameter2 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>���ҳ</a></div></td>\n");

			} else if (parameter1 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName1 + "=" + parameter1 + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName1 + "=" + parameter1 + "'>���ҳ</a></div></td>\n");
			} else if (parameter2 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName2 + "=" + parameter2 + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName2 + "=" + parameter2 + "'>���ҳ</a></div></td>\n");

			}

			else {
				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "'>��һҳ</a></div></td>\n");
				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "'>���ҳ</a></div></td>\n");
			}
		} else {

			output.append("<td align=center  class=fContent> <div align=left>��һҳ</div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left>���ҳ</div></td>\n");
		}
		output.append("<td align=center  class=fContent> <div align=left>��ǰ��" + currentPage + "ҳ/��" + totalNum
				+ "ҳ</div></td>\n");
		output.append("<td align=center  class=fContent><div align=left>����\n");
		if (totalNum == 0) {
			output.append("<select name=currPage onChange='this.form.submit()' disabled>\n");
		} else {
			output.append("<select name=currPage onChange='this.form.submit()'>\n");
		}
		for (int i = 1; i <= totalNum; i++) {
			if (i == currentPage) {
				output.append("<option value=" + i + " selected>" + i + "</option>\n");
			} else {
				output.append("<option value=" + i + ">" + i + "</option>\n");
			}
		}
		output.append("</select>ҳ\n");
		output.append("</tr></table></form>\n");

		return output.toString();
	}

	/**
	 * lgs�����07.4.27 15��31 ��Ҫ��ϴ�����t��
	 * 
	 * @param page
	 * @param paraName1
	 * @param parameter1
	 * @param paraName2
	 * @param parameter2
	 * @return
	 */
	public String printTableNew(String page, String paraName1, String parameter1, String paraName2, String parameter2) {
		output.delete(0, output.length());
		if (parameter1 != null && parameter2 != null) {
			output.append("<form method=post name=page action=" + page + "&" + paraName1 + "=" + parameter1 + "&"
					+ paraName2 + "=" + parameter2 + ">\n");

		}
		if (parameter1 != null && parameter2 == null) {
			output.append("<form method=post name=page action=" + page + "&" + paraName1 + "=" + parameter1 + ">\n");

		}
		if (parameter1 == null && parameter2 != null) {
			output.append("<form method=post name=page action=" + page + "&" + paraName2 + "=" + parameter2 + ">\n");

		}
		if (parameter1 == null && parameter2 == null) {
			output.append("<form method=post name=page action=" + page + ">\n");

		}

		output.append("<table width=100%>\n");
		output.append("<tr>\n");
		if (parameter1 == null && parameter2 == null) {
			output.append("<td align=center  class=fContent>��" + totalCount + "��</td>\n");
		} else {
			output.append("<td align=center  class=fContent><font color=#FF0000>�������ѯ����Ĺ�" + totalCount
					+ "��</font></td>\n");
		}

		if (currentPage <= 1) {
			output.append("<td align=center  class=fContent><div align=left>��ҳ</div></td>\n");
			output.append("<td  align=center  class=fContent><div align=left>��һҳ</div></td>\n");
		} else {
			// ����Ϊ�յ����
			if (parameter1 != null && parameter2 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage=1&"
						+ paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ (currentPage - 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>��һҳ</a></div></td>\n");

			} else if (parameter1 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage=1&"
						+ paraName1 + "=" + parameter1 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ (currentPage - 1) + "&" + paraName1 + "=" + parameter1 + "'>��һҳ</a></div></td>\n");
			} else if (parameter2 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage=1&"
						+ paraName2 + "=" + parameter2 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ (currentPage - 1) + "&" + paraName2 + "=" + parameter2 + "'>��һҳ</a></div></td>\n");

			}

			else {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page
						+ "&currPage=1'>��ҳ</a></div></td>\n");
				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ (currentPage - 1) + "'>��һҳ</a></div></td>\n");

			}

		}

		if (currentPage != totalNum && totalNum != 0) {

			// ����Ϊ�յ����
			if (parameter1 != null && parameter2 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ (currentPage + 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ totalNum + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>���ҳ</a></div></td>\n");

			} else if (parameter1 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ (currentPage + 1) + "&" + paraName1 + "=" + parameter1 + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ totalNum + "&" + paraName1 + "=" + parameter1 + "'>���ҳ</a></div></td>\n");
			} else if (parameter2 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ (currentPage + 1) + "&" + paraName2 + "=" + parameter2 + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ totalNum + "&" + paraName2 + "=" + parameter2 + "'>���ҳ</a></div></td>\n");

			}

			else {
				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ (currentPage + 1) + "'>��һҳ</a></div></td>\n");
				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "&currPage="
						+ totalNum + "'>���ҳ</a></div></td>\n");
			}
		} else {

			output.append("<td align=center  class=fContent> <div align=left>��һҳ</div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left>���ҳ</div></td>\n");
		}
		output.append("<td align=center  class=fContent> <div align=left>��ǰ��" + currentPage + "ҳ/��" + totalNum
				+ "ҳ</div></td>\n");
		output.append("<td align=center  class=fContent><div align=left>����\n");
		if (totalNum == 0) {
			output.append("<select name=currPage onChange='this.form.submit()' disabled>\n");
		} else {
			output.append("<select name=currPage onChange='this.form.submit()'>\n");
		}
		for (int i = 1; i <= totalNum; i++) {
			if (i == currentPage) {
				output.append("<option value=" + i + " selected>" + i + "</option>\n");
			} else {
				output.append("<option value=" + i + ">" + i + "</option>\n");
			}
		}
		output.append("</select>ҳ\n");
		output.append("</tr></table></form>\n");

		return output.toString();
	}

	public String printTable(String page, String paraName1, String parameter1, String paraName2, String parameter2,
			String paraName3, String parameter3) {
		output.delete(0, output.length());
		output.append("<form method=post action='" + page + "'>\n"
				+ "<table width=100%  cellspacing=0 cellpadding=0>\n");
		output.append("<tr>\n");
		if (parameter1 == null && parameter2 == null && parameter3 == null) {
			output.append("<td align=center  class=fContent><font color=#FF0000>��" + totalCount + "��</font></td>\n");
		} else {
			output.append("<td align=center  class=fContent><font color=#FF0000>�������ѯ����Ĺ�" + totalCount
					+ "��</font></td>\n");
		}

		if (currentPage <= 1) {
			output.append("<td align=center  class=fContent><div align=left>��ҳ</div></td>\n");
			output.append("<td align=center  class=fContent><div align=left>��һҳ</div></td>\n");
		} else {
			// ����Ϊ�յ����
			if (parameter1 != null && parameter2 != null && parameter3 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2 + "&" + paraName3 + "="
						+ parameter3 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "&" + paraName3 + "=" + parameter3 + "'>��һҳ</a></div></td>\n");

			}

			if (parameter1 != null && parameter2 != null && parameter3 == null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>��һҳ</a></div></td>\n");

			}
			if (parameter1 != null && parameter2 == null && parameter3 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName1 + "=" + parameter1 + "&" + paraName3 + "=" + parameter3 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName3 + "=" + parameter3
						+ "'>��һҳ</a></div></td>\n");

			}

			if (parameter1 == null && parameter2 != null && parameter3 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName2 + "=" + parameter2 + "&" + paraName3 + "=" + parameter3 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName2 + "=" + parameter2 + "&" + paraName3 + "=" + parameter3
						+ "'>��һҳ</a></div></td>\n");

			}
			if (parameter1 == null && parameter2 == null && parameter3 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName3 + "=" + parameter3 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName3 + "=" + parameter3 + "'>��һҳ</a></div></td>\n");

			}
			if (parameter1 == null && parameter2 != null && parameter3 == null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName2 + "=" + parameter2 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName2 + "=" + parameter2 + "'>��һҳ</a></div></td>\n");

			}
			if (parameter1 != null && parameter2 == null && parameter3 == null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1&"
						+ paraName1 + "=" + parameter1 + "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "&" + paraName1 + "=" + parameter1 + "'>��һҳ</a></div></td>\n");

			}
			if (parameter1 == null && parameter2 == null && parameter3 == null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage=1"
						+ "'>��ҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage - 1) + "'>��һҳ</a></div></td>\n");

			}

		}

		if (currentPage != totalNum && totalNum != 0) {

			// ����Ϊ�յ����
			if (parameter1 != null && parameter2 != null && parameter3 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "&" + paraName3 + "=" + parameter3 + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2 + "&"
						+ paraName3 + "=" + parameter3 + "'>���ҳ</a></div></td>\n");

			}

			if (parameter1 != null && parameter2 != null && parameter3 == null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName1 + "=" + parameter1 + "&" + paraName2 + "=" + parameter2
						+ "'>���ҳ</a></div></td>\n");

			}
			if (parameter1 != null && parameter2 == null && parameter3 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName1 + "=" + parameter1 + "&" + paraName3 + "=" + parameter3
						+ "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName1 + "=" + parameter1 + "&" + paraName3 + "=" + parameter3
						+ "'>���ҳ</a></div></td>\n");

			}

			if (parameter1 == null && parameter2 != null && parameter3 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName2 + "=" + parameter2 + "&" + paraName3 + "=" + parameter3
						+ "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName2 + "=" + parameter2 + "&" + paraName3 + "=" + parameter3
						+ "'>���ҳ</a></div></td>\n");

			}
			if (parameter1 == null && parameter2 == null && parameter3 != null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName3 + "=" + parameter3 + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName3 + "=" + parameter3 + "'>���ҳ</a></div></td>\n");

			}
			if (parameter1 == null && parameter2 != null && parameter3 == null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName2 + "=" + parameter2 + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName2 + "=" + parameter2 + "'>���ҳ</a></div></td>\n");

			}
			if (parameter1 != null && parameter2 == null && parameter3 == null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "&" + paraName1 + "=" + parameter1 + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "&" + paraName1 + "=" + parameter1 + "'>���ҳ</a></div></td>\n");

			}
			if (parameter1 == null && parameter2 == null && parameter3 == null) {

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ (currentPage + 1) + "'>��һҳ</a></div></td>\n");

				output.append("<td align=center  class=fContent> <div align=left><a href='" + page + "?currPage="
						+ totalNum + "'>���ҳ</a></div></td>\n");
			}
		} else {
			output.append("<td align=center  class=fContent> <div align=left>��һҳ</div></td>\n");
			output.append("<td align=center  class=fContent> <div align=left>���ҳ</div></td>\n");
		}
		output.append("<td align=center  class=fContent> <div align=left>��ǰ��" + currentPage + "ҳ/��" + totalNum
				+ "ҳ</div></td>\n");
		output.append("<td align=center  class=fContent><div align=left>����\n");
		if (totalNum == 0) {
			output.append("<select name=currPage onChange='this.form.submit()' disabled>\n");
		} else {
			output.append("<select name=currPage onChange='this.form.submit()'>\n");
		}
		for (int i = 1; i <= totalNum; i++) {
			if (i == currentPage) {
				output.append("<option value=" + i + " selected>" + i + "</option>\n");
			} else {
				output.append("<option value=" + i + ">" + i + "</option>\n");
			}
		}
		output.append("</select>ҳ\n");
		output.append("</tr></table></form>\n");

		return output.toString();
	}

}
